<!--[if lte IE 6]>
<style>
#fix{
	height: 2500px;
}
</style>
<![endif]-->
<div id="fix">
<?php 
	$sql6="select * from nhomsanpham where id_nhom=1";
	$kq6=mysql_query($sql6);
	$i=7;
	while ($r6=mysql_fetch_array($kq6))
	{
		$id_nhom6=$r6["id_nhom"];
		//echo "$i<hr>";
?>
<div id="TabbedPanels<?php echo $i; ?>" class="TabbedPanels">
  <ul class="TabbedPanelsTabGroup">
  <?php	$sql4="select * from loaisanpham where id_nhom=$id_nhom6 and id_loai IN (3,4,5) and ghichu='hienthi'";		
		$kq4=mysql_query($sql4);			
		while($r4=mysql_fetch_array($kq4)){
			$id_loai4=$r4["id_loai"];
			$ten_loai4=$r4["tenloaisp"];
			 echo "<li class=\"TabbedPanelsTab\" tabindex=0>$ten_loai4</li>";
 } ?>   
  </ul>
  <div class="TabbedPanelsContentGroup">
   <?php
   		$sql_nd4="select * from loaisanpham where id_nhom=$id_nhom6 and id_loai IN (3,4,5) and ghichu='hienthi'";		
		$kq_nd4=mysql_query($sql_nd4);		
		while($r_nd4=mysql_fetch_array($kq_nd4)){
			$id_loai_nd4=$r_nd4["id_loai"];
			$ten_loai_nd4=$r_nd4["tenloaisp"];
  ?>
    <div class="TabbedPanelsContent2">
    <table width="560" border="0" cellspacing="0" cellpadding="0">
      <tr>
        <td align="center" style="padding-left:5px;">
    <?php          
			$sql5="select * from sanpham where id_loai=$id_loai_nd4  order by rand() limit 0,6";			
            $kq5=mysql_query($sql5);
			if(!$kq5) echo "";
			else{
			while($r5=mysql_fetch_array($kq5))
			{
				$id5=$r5["id"];$tensp5=$r5["tensp"];$hinh5=$r5["hinh"];$gia5=$r5["gia"];
				$gia52=number_format($gia5,0,'','.');
				if($gia5==0) $s5="(liên hệ)";	else { $s5=$gia52." VND"; }				
				echo "<div class=divshow2>
				<table width=175 height=220 border=0 cellspacing=0 cellpadding=0 background=\"images/box.gif\" style=\"border:1px dotted #999\">
				  <tr>
					<td height=170><a href=?b=ct&id=$id5><img src='sanpham/small/$hinh5' width=170px height=170 border=0> </a></td>
				  </tr>
				  <tr>
					<td height=25 style=\"font-size:15px; color:#F00\"><a href=?b=ct&id=$id5 class=a-m><strong>$tensp5</strong></a><img src=\"images/new.gif\" width=28 height=11 /></td>
				  </tr>
				  <tr>
					<td height=25>Giá: $s5</td>				 
				</table>			
				</div>";
			}
			}
	?>
    </td>
          </tr>
          </tr>
			 <td style="border-top:0px solid #999; padding-top:5px"><div align=right><a href="?b=lsp&idl=<?php echo $id_loai_nd4; ?>">Xem thêm &raquo;&nbsp;&nbsp;</a></div></td>
          </tr> 
        </table>
    </div>
    <?php } ?>
  </div>
</div>
<script type="text/javascript">
<!--
var TabbedPanels<?php echo $i; ?> = new Spry.Widget.TabbedPanels("TabbedPanels<?php echo $i; ?>");
//-->
</script>
<?php 
	$i++;
	}
//***********************************************************************************
?>

<?php 
	$sql7="select * from nhomsanpham where id_nhom=1";
	$kq7=mysql_query($sql7);
	while ($r7=mysql_fetch_array($kq7))
	{
		$id_nhom7=$r7["id_nhom"];
		//echo "$id_nhom7<hr>";
?>
<div id="TabbedPanels<?php echo $id_nhom7; ?>" class="TabbedPanels">
  <ul class="TabbedPanelsTabGroup">
  <?php	$sql8="select * from loaisanpham where id_nhom=$id_nhom7 and id_loai IN (18,19,25) and ghichu='hienthi'";		
		$kq8=mysql_query($sql8);			
		while($r8=mysql_fetch_array($kq8)){
			$id_loai8=$r8["id_loai"];
			$ten_loai8=$r8["tenloaisp"];
			 echo "<li class=\"TabbedPanelsTab\" tabindex=0>$ten_loai8</li>";
 } ?>   
  </ul>
  
  <div class="TabbedPanelsContentGroup">
   <?php
   		$sql_nd8="select * from loaisanpham where id_nhom=$id_nhom7 and id_loai IN (18,19,25) and ghichu='hienthi'";		
		$kq_nd8=mysql_query($sql_nd8);		
		while($r_nd8=mysql_fetch_array($kq_nd8)){
			$id_loai_nd8=$r_nd8["id_loai"];
			$ten_loai_nd8=$r_nd8["tenloaisp"];
  ?>
    <div class="TabbedPanelsContent2">
    <table width="560" border="0" cellspacing="0" cellpadding="0">
      <tr>
        <td align="center" style="padding-left:5px;">
    <?php          
			$sql9="select * from sanpham where id_loai=$id_loai_nd8  order by rand() limit 0,6";			
            $kq9=mysql_query($sql9);
			if(!$kq9) echo "";
			else{
			while($r9=mysql_fetch_array($kq9))
			{
				$id9=$r9["id"];$tensp9=$r9["tensp"];$hinh9=$r9["hinh"];$gia9=$r9["gia"];
				$gia92=number_format($gia9,0,'','.');
				if($gia9==0) $s9="(liên hệ)";	else { $s9=$gia92." VND"; }				
				echo "<div class=divshow2>
				<table width=175 height=220 border=0 cellspacing=0 cellpadding=0 background=\"images/box.gif\" style=\"border:1px dotted #999\">
				  <tr>
					<td height=170><a href=?b=ct&id=$id9><img src='sanpham/small/$hinh9' width=170px height=170 border=0> </a></td>
				  </tr>
				  <tr>
					<td height=25 style=\"font-size:15px; color:#F00\"><a href=?b=ct&id=$id9 class=a-m><strong>$tensp9</strong></a><img src=\"images/new.gif\" width=28 height=11 /></td>
				  </tr>
				  <tr>
					<td height=25>Giá: $s9</td>				 
				</table>		
				</div>";
			}
			}
	?>
     		 </td>
          </tr>
          </tr>
			 <td style="border-top:0px solid #999; padding-top:5px"><div align=right><a href="?b=lsp&idl=<?php echo $id_loai_nd8; ?>">Xem thêm &raquo;&nbsp;&nbsp;</a></div></td>
          </tr> 
        </table>
    </div>
    <?php } ?>
  </div>
</div>
<script type="text/javascript">
<!--
var TabbedPanels<?php echo $id_nhom7; ?> = new Spry.Widget.TabbedPanels("TabbedPanels<?php echo $id_nhom7; ?>");
//-->
</script>
<?php } ?>

<?php 
//***************************************************************************************
	$sql="select * from nhomsanpham where id_nhom NOT IN (1)";
	$kq=mysql_query($sql);
	while ($r=mysql_fetch_array($kq))
	{
		$id_nhom=$r["id_nhom"];
		//echo "$id_nhom<hr>";
?>
<!-- *********************************2********************************************* -->
<div id="TabbedPanels<?php echo $id_nhom; ?>" class="TabbedPanels">
  <ul class="TabbedPanelsTabGroup">
  <?php	$sql2="select * from loaisanpham where id_nhom=$id_nhom and ghichu='hienthi'";		
		$kq2=mysql_query($sql2);			
		while($r2=mysql_fetch_array($kq2)){
			$id_loai=$r2["id_loai"];
			$ten_loai=$r2["tenloaisp"];
			 echo "<li class=\"TabbedPanelsTab\" tabindex=0>$ten_loai</li>";
 } ?>   
  </ul>
  <div class="TabbedPanelsContentGroup">
   <?php
   		$sql_nd="select * from loaisanpham where id_nhom=$id_nhom and ghichu='hienthi'";		
		$kq_nd=mysql_query($sql_nd);		
		while($r_nd=mysql_fetch_array($kq_nd)){
			$id_loai_nd=$r_nd["id_loai"];
			$ten_loai_nd=$r_nd["tenloaisp"];
  ?>
    <div class="TabbedPanelsContent2">
    <table width="560" border="0" cellspacing="0" cellpadding="0">
      <tr>
        <td align="center" style="padding-left:5px;">
    <?php          
			$sql3="select * from sanpham where id_loai=$id_loai_nd  order by rand() limit 0,6";			
            $kq3=mysql_query($sql3);
			if(!$kq3) echo "";
			else{
			while($r3=mysql_fetch_array($kq3))
			{
				$id=$r3["id"];$tensp=$r3["tensp"];$hinh=$r3["hinh"];$gia=$r3["gia"];
				$gia2=number_format($gia,0,'','.');
				if($gia==0) $s="(liên hệ)";	else { $s=$gia2." VND"; }				
				echo "<div class=divshow2>
				<table width=175 height=220 border=0 cellspacing=0 cellpadding=0 background=\"images/box.gif\" style=\"border:1px dotted #999\">
				  <tr>
					<td height=170><a href=?b=ct&id=$id><img src='sanpham/small/$hinh' width=170px height=170 border=0> </a></td>
				  </tr>
				  <tr>
					<td height=25 style=\"font-size:15px; color:#F00\"><a href=?b=ct&id=$id class=a-m><strong>$tensp</strong></a><img src=\"images/new.gif\" width=28 height=11 /></td>
				  </tr>
				  <tr>
					<td height=25>Giá: $s</td>				 
				</table>		
				</div>";
			}
			}
	?>
     		 </td>
          </tr>
          </tr>
			 <td style="border-top:0px solid #999; padding-top:5px"><div align=right><a href="?b=lsp&idl=<?php echo $id_loai_nd; ?>">Xem thêm &raquo;&nbsp;&nbsp;</a></div></td>
          </tr> 
        </table>
    </div>
    <?php } ?>
  </div>
</div>
<script type="text/javascript">
<!--
var TabbedPanels<?php echo $id_nhom; ?> = new Spry.Widget.TabbedPanels("TabbedPanels<?php echo $id_nhom; ?>");
//-->
</script>
<?php } ?>
</div>